package entities;

import java.io.Serializable;
import javax.persistence.*;

import java.math.BigDecimal;

/**
 * The persistent class for the medicineinfo database table.
 * 
 */
@Entity
@Table(name = "medicine_info")
public class MedicineInfo implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idMedicineInfo;
	private String medicineName;
	private BigDecimal price;
	private int reOrderLevel;
	private int stockLevel;

	public MedicineInfo() {
	}

	public MedicineInfo(String medicineName, BigDecimal price, int reOrderLevel, int stockLevel) {
		super();
		this.medicineName = medicineName;
		this.price = price;
		this.reOrderLevel = reOrderLevel;
		this.stockLevel = stockLevel;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique = true, nullable = false)
	public int getIdMedicineInfo() {
		return this.idMedicineInfo;
	}

	public void setIdMedicineInfo(int idMedicineInfo) {
		this.idMedicineInfo = idMedicineInfo;
	}

	@Column(nullable = false, length = 100)
	public String getMedicineName() {
		return this.medicineName;
	}

	public void setMedicineName(String medicineName) {
		this.medicineName = medicineName;
	}

	@Column(nullable = false, precision = 10)
	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(nullable = false)
	public int getReOrderLevel() {
		return this.reOrderLevel;
	}

	public void setReOrderLevel(int reOrderLevel) {
		this.reOrderLevel = reOrderLevel;
	}

	@Column(nullable = false)
	public int getStockLevel() {
		return this.stockLevel;
	}

	public void setStockLevel(int stockLevel) {
		this.stockLevel = stockLevel;
	}

	@Override
	public String toString() {
		return this.getClass().getName() + "[ " + idMedicineInfo + " | " + medicineName + " | "
				+ price + " | " + reOrderLevel + " | " + stockLevel + " ]";
	}

}